using UnityEngine;

public class PlayerIdleState: PlayerGroundState
{
    public PlayerIdleState(ControllerBase controller, StateMachineBase stateMachine, string stateName,string 
        animatorParameter) 
        : base(controller, stateMachine, stateName,animatorParameter)
    {
    }

    public override void Enter()
    {
        base.Enter();
        //controller.SetVelocity(Vector2.zero);
        controller.SetVelocity(new Vector2(0, controller.GetVelocity().y));
    }

    public override void Update()
    {
        base.Update();
        if (SelfController.moveX!=0&&!controller.isBusy)//当前有移动输入且没有被占用时，切换为移动状态
        {
            stateMachine.ChangeState(Setting.move);
            return;
        }
        
        
    }

    public override void Exit()
    {
        base.Exit();
    }
}
